const http = require("http");
const fs = require('fs');
const url = require("url");

const app = http.createServer((req, res) => {
    // 设置头信息
    res.writeHead(200, {
        'Content-Type': 'text/html;charset=utf-8'
    });
    switch (req.url) {
        case '/':
            res.end("首页");
            break;
        case '/user':
            res.end("用户页");
            break;
        case '/live':
            res.end("公众号");
            break;
        default:
            break;
    }
});



app.listen((8221), () => {
    console.log(`Server started on port`);
});